1. Field of the Invention
The present invention relates to a method, system, and program for using neural networks for converting application program code to executable code based on characteristics of the inputs.
2. Description of the Related Art
The Java** Platform provides an added layer of execution between the underlying operating system and programs written in the Java computer language. The Java Platform converts Java source code (.Java files) to bytecodes (.class files), which are machine independent representations of a Java class. Thus, the same bytecodes would be created for all operating system platforms. The bytecodes are then inputted to a Java Virtual Machine program that converts the bytecodes to the object code in the native machine language of the operating system on which the Java Virtual Machine is installed. Thus, there is a platform-specific Java Virtual Machine program for each platform on which Java programs can execute.
**WINDOWS and MICROSOFT are registered trademarks of Microsoft Corporation; AIX, OS/2 are registered trademarks of IBM; JAVA is a trademark of Sun Microsystems, Inc. 
The Java Virtual Machine typically includes two components, an Interpreter and a Just-In-Time (JIT) Compiler. The bytecodes are either interpreted by the Interpreter or turned into native machine code by the JIT Compiler. The native code may then be executed to run the Java program. The JIT Compiler is intended to generate code faster for certain methods that are called frequently. The JIT operates by searching for strings having a recognizable pattern in the bytecodes. The JIT provides a mapping of such recognizable strings of bytecodes to native code statements. The JIT compiler reuses copies of translated bytecodes to speed up the compilation process. In this way, the JIT Compiler can quickly convert recognizable segments of the byte code to native code.
FIG. 1 illustrates the prior art method for converting Java source code to executable native machine code through the use of the Java Interpreter and JIT Compiler.
Java source code may be encapsulated in a Java program referred to as a Java Applet, which is an application program that executes within a Java enabled viewing program, such as an Internet web browser. Both the Microsoft Internet Explorer and Netscape Communications Corporation Internet web browsers include a Java Virtual Machine (JVM) to execute the Java applet code.** Unlike general Java programs, Applets cannot be executed directly from the operating system.
**WINDOWS and MICROSOFT are registered trademarks of Microsoft Corporation; AIX, OS/2 are registered trademarks of IBM; JAVA is a trademark of Sun Microsystems, Inc. 
To load an Applet program into the browser environment, a special Hypertext Markup Language (HTML) Applet tag is embedded in an HTML page that instructs the browser to load the compiled Java bytecodes for a Java applet program from a universal resource locator (URL) address. The browser JVM would then convert the Applet bytecodes to native machine code. Applets are commonly included in Internet web pages to deliver content and programs over the Internet. Applets have built in security features that restrict their ability to read or write files and open additional network connections on the computer in which they are executing.
There is a need in the art for further improvements for transforming Java Applet bytecodes into native code that may be executed by the native operating system platform on which the Java Virtual Machine is running.
Provided is a compiler to map application program code to object code capable of being executed on an operating system platform. A first neural network module is trained to generate characteristic output based on input information describing attributes of the application program. A second neural network module is rained to receive as input the application program code and the characteristic output and, in response, generate object code. The first and second neural network modules are used to convert the application program code to object code.
Further, training the second neural network module may involve training a first and second neural network components. The first neural network component is trained to map the application program code to a unique representation of the application program code. The second neural network component is trained to generate executable code from the unique representation of the application program code and the characteristic output.
Still further, the first neural network module may comprise a plurality of characterization neural networks. In such case, training the characterization neural networks comprises determining attribute information of the application program code and transmitting the attribute information to each characterization neural network to determine an application type to which the application program is capable of belonging. The characteristic output indicates the application type for the application program.
The described implementations provide a mechanism for utilizing neural networks to provide a mapping from an input code set, such as Java Applet bytecodes implementing a class, to native machine code. The preferred embodiments are especially useful for substantially reducing the time needed to compile Java Applet bytecodes into native machine code. The described implementations avoid having to interpret any portion of the bytecodes. Instead, neural networks are utilized to map the Java Applet bytecodes to native machine code in a manner that is substantially faster than current Java Virtual Machine implementations using Interpreters and JIT Compilers. The neural networks of the preferred embodiments further reduce compilation time by parallel processing the input bytecodes and by providing a mapping that avoids the need for time consuming interpretation operations.